import Vue from 'vue'
import Vuex from 'vuex'
import http from './http'

Vue.use(Vuex)
const plugins = process.env.NODE_ENV === 'development' ? [Vuex.createLogger()] : []
export default new Vuex.Store({
  plugins,
  state: {},
  actions: {
    set({ commit }, data) {
      commit('SET', data)
    }
  },
  mutations: {
    SET(state, data) {
      for (const i of Object.keys(data)) state[i] = data[i]
    }
  }
})
